#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <Dictionnary.hh>
#include <dict_client_i.cc>
#ifdef HAVE_STD
#include <iostream>
using namespace std;
#else
#include <iostream.h>
#endif
#include "informationdialog.h"
#include <string>
using namespace Dict;

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    void initArguments(int _argc, char **_argv);
    static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb);
    int initCorba(Dictionnary_var _dictref, int argc, char **argv);
    void destroy();
    void clearAddingValues();
    void clearModifyValues();
    void clearDeleteValues();
    void setStatusMesg();
    ~MainWindow();

protected:
    void changeEvent(QEvent *e);

public:
    // L'object dictionnary
    Dictionnary_var dictref;
    CORBA::ORB_var orb;    

private:
    Ui::MainWindow *ui;
    QString statusLoadMesg;
    QString statusSaveMesg;
    QString statusLengthMesg;
    QString statusMesg;
    InformationDialog* inforDialog;

private slots:
    void on_buttonModify_clicked();
    void on_buttonDelete_clicked();
    void on_buttonAdd_clicked();
    void on_actionExit_activated();
    void on_actionDictLength_activated();
    void on_actionSave_activated();
    void on_actionLoad_activated();
    void on_actionSort_Descending_activated();
    void on_actionSort_Ascending_activated();
    void on_radioAdjective_clicked(bool checked);
    void on_radioVerb_clicked(bool checked);
    void on_radioNoun_clicked(bool checked);
};

#endif // MAINWINDOW_H
